/* Copyright 2010 Google Inc.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS.
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License
 */

package org.file5.domain;

import org.file5.util.UUIDUtil;

import com.googlecode.objectify.Key;
import com.googlecode.objectify.annotation.NotSaved;


 
public class EntityIndex<E extends BaseEntity > extends BaseEntity {
 

 
    /**
	 * 
	 */
	private static final long serialVersionUID = -602113374162589636L;

	private int indexed;

	private Key<E> entityKey;
	@NotSaved 
	E entity;
	
	
	public EntityIndex() {
	}

	public EntityIndex(Class<E> entityClass,String uid){
		super.uid = UUIDUtil.getRandomUUID();
		this.entityKey = new Key<E>(entityClass,uid);
		this.indexed = 0;
	}
	
	public int getIndexed() {
		return indexed;
	}
	public void setIndexed(int indexed) {
		this.indexed = indexed;
	}
	public Key<E> getEntityKey() {
		return entityKey;
	}
	public void setEntityKey(Key<E> entityKey) {
		this.entityKey = entityKey;
	}
	public E getEntity() {
		return entity;
	}
	public void setEntity(E entity) {
		this.entity = entity;
	}

}

